package fr.ensisa.sunspot.automate;

import java.util.ArrayList;

import fr.ensisa.sunspot.actor.Template;
import fr.ensisa.sunspot.event.IEvent;
import fr.ensisa.sunspot.event.IntegerEvent;

public class FactoryAutomate {

	public static Automate testAutomate() {
		Automate automate = new Automate();
		
		State state1 = new State(automate);
//		State state2 = new State(automate);
		State state3 = new State(automate);
		state3.setFinalState(true);
		IntegerEvent i = new IntegerEvent(IEvent.MAJOR_LIGHT, IEvent.MINOR_LEFT);
		ArrayList<IEvent> todo3 = new ArrayList<IEvent>();
		todo3.add(i);
		state3.setTodo(todo3);
		
		Template template1 = new Template();
		template1.addEvent(new IntegerEvent(IEvent.MAJOR_KEYBOARD, IEvent.MINOR_NO));
		Transition transition1 = new Transition(state3, template1);
//		Template template2 = new Template();
//		template2.addEvent(new IntegerEvent(IEvent.MAJOR_LIGHT, IEvent.MINOR_NO));
//		Transition transition2 = new Transition(state3, template2);
		
		state1.addTransition(transition1);
//		state1.addTransition(transition2);
		
		automate.addFirstState(state1);
		
		
		
		return automate;
	}
	
}
